v1=rand(3000000,1);
v2=v1;
%% multiply each element by 3，for loop
tic;
for i=1:length(v1)
    v1(i)=v1(i)*3;
end
toc;
%% multiply each element by 3,vector operation
tic;
v2=v2*3;
toc;